<template>
    <div>
        <p v-for=" item in tasks" :key="item.id">
            <input type="checkbox" :checked="item.isDone" @click="create(!item.isDone,item.id)">
            <span> {{item.name}}</span>
        </p>
    </div>
</template>

<script setup>
import {defineProps ,defineEmits} from 'vue'
// 定义 props
defineProps({
    tasks: {
        type: Array

    }
    
});

let emits = defineEmits(['sendData']);
let create = function (value,num){
    emits('sendData',value,num);
}
</script>

<style>

</style>